package com.example.last.dao;

import com.example.last.entity.*;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface NoticeDao {
    List<Notice> findBySearch(@Param("params") Params params);

    @Insert("Insert into notice (name, content, time) values (#{name}, #{content}, #{time})")
    void add(Notice notice);

    @Delete(("delete from notice where id = #{id} "))
    void delete(Integer id);

    @Update("Update notice set name = #{name}, content = #{content}, time = #{time} where id = #{id}")
    void update(Notice notice);

    @Select("select * from notice ")
    List<Notice> findAll();
}
